package br.usjt.lab.hirose;

import java.awt.*;

import javax.swing.JFrame;

public class FloodFillFila{
	
	PtCartesiano aux;
	private PtCartesiano w;
	private PtCartesiano s;
	private PtCartesiano e;
	private PtCartesiano n;
	Color color;
	private PtCartesiano atual;
	
	public FloodFillFila(PtCartesiano p1, Color entrada, Color alterada){
		p1 = null;
		
		p1 = new PtCartesiano(p1.x, p1.y);
		aux = p1;
		int i = 1;
		while(atual.link != null){
			atual = aux;
			
			aux.west = aux;
			aux.south = aux;
			aux.east = aux;
			aux.north = aux;
			
			if(atual.getC() == entrada){
				atual.west.setC(alterada);
				atual.south.setC(alterada);
				atual.east.setC(alterada);
				atual.north.setC(alterada); 
			}
		}
	}
	
	public static void main(String[] args) {
		JFrame frame = new JFrame();
	}
}
/*
 Flood-fill (node, target-color, replacement-color):
 1. Set Q to the empty queue. - 
 2. Add node to the end of Q. - 
 4. While Q is not empty: 
 5.     Set n equal to the last element of Q.
 7.     Remove last element from Q.
 8.     If the color of n is equal to target-color:
 9.         Set the color of n to replacement-color.
 10.        Add west node to end of Q.
 11.        Add east node to end of Q.
 12.        Add north node to end of Q.
 13.        Add south node to end of Q.
 14. Return.
 
 * 
 * 
 * */
 